package org.autocode.util;

import freemarker.template.SimpleDate;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @program: autocode
 * @description:
 * @author: zhu.xiaojie
 * @create: 2020-08-23 09:28
 */
public class DateUtils {

    public static String format(Date date){
        return format(date , "yyyy-MM-dd HH:mm:ss");
    }

    /**
     *
     * @param date
     * @param pattern
     * @return
     */
    public static String format(Date date , String pattern){
        SimpleDateFormat sdf = new SimpleDateFormat(pattern);

        String format = sdf.format(date);
        return format;
    }
}
